﻿using DFGK_WMS.Model.Dto;
using DFGK_WMS.Model.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DFGK.IService
{
    public interface IShippingOrderDetailService
    {
        /// <summary>
        /// 添加出库单
        /// </summary>
        /// <param name="m"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        bool AddShippingOrderDetail(ShippingOrderDetail m, out string message);

        /// <summary>
        /// 拣选出库回流
        /// </summary>
        /// <param name="m"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        bool StartPickingShippingOrderDetail(StartInventoryDTO m, out string message);

        /// <summary>
        /// 完成拣选入库
        /// </summary>
        /// <param name="putcode"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        bool FinishPickingShippingOrderDetail(string putcode, out string message);

        /// <summary>
        /// 出库单查询
        /// </summary>
        /// <param name="ordersn"></param>
        /// <param name="billtype"></param>
        /// <param name="materialkey"></param>
        /// <param name="status"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        List<ShippingOrderDetail> GetShippingOrderDetailList(string? ordersn, int? billtype, string? materialkey, int status, int pageIndex, int pageSize, out int totalCount);

        /// <summary>
        /// 获取出库物料
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        List<ShippingSelectMaterialDto> GetInventoryByMaterialAll(int pageIndex, int pageSize, string? mname,string? arecode, out int count);

        /// <summary>
        /// 删除出库管理
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        bool DelShippingOrderDetail(long id, out string message);

        /// <summary>
        /// 根据主键获取对象
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        ShippingOrderDetail? GetShippingOrderDetailById(long id);

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="m"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        bool UpdShippingOrderDetail(ShippingOrderDetail m, out string message);

        /// <summary>
        /// PDA出库选择明细
        /// </summary>
        /// <param name="key"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        List<ShippingOrderDetailGroupDTO> GetShippingOrderDetailGroup(string key,int pageIndex,int pageSize,out int totalCount);

        /// <summary>
        /// 开始出库
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        bool StartShippingOrderDetail(List<SubmitOutListDTO> m,out string message);

        /// <summary>
        /// 完成出库
        /// </summary>
        /// <param name="putcode"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        bool FinishShippingOrderDetail(string putcode, out string message);

        /// <summary>
        /// 根据托盘查询组垛信息
        /// </summary>
        /// <param name="PalletCode"></param>
        /// <returns></returns>
        StackingReceivingsDto? GetReceivingRoderData(string PalletCode, out string message);

        /// <summary>
        /// 拣选入库时呼叫库存中的料箱
        /// </summary>
        /// <param name="OrderDTO"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        bool StartShippingOutZeroQty(List<SubmitOutListDTO> OrderDTO,out string message);

        /// <summary>
        /// 完成拣选出库
        /// </summary>
        /// <param name="putcode"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        bool FinishShippingOutZeroQty(string pickcode, out string message);

        /// <summary>
        /// 取消出库任务
        /// </summary>
        /// <param name="pallCode"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        bool WCSCancelTask(string pallCode, out string message);

        /// <summary>
        /// EBS下发出库单
        /// </summary>
        /// <param name="eBSShippingOrder"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        bool EBSAddShippingOrderDetail(EBSShippingOrderDTO eBSShippingOrder, out string message);
    }
}
